﻿using EmbeddedSharp.Core;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Zove.Runtime.Test
{
    [TestClass]
    public class StringTests : AbstractTests
    {
        [TestMethod]
        public void TestSubstring()
        {
            base.AssertExpression(
                "substr(\"hello, world\", 2, 3)", "llo");
        }

        [TestMethod]
        public void TestReplace2()
        {
            Assert.AreEqual(
                "t.c+hello",
                Utils.ReplaceString("c", "hello", "t.c+c"));
        }

        [TestMethod]
        public void TestReplace()
        {
            base.AssertExpression(
                "replace(\"hello, world\", \"world\", \"kitty\")", "hello, kitty");
        }
    }
}